package org.wzl.todolisthelper.controller;

import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.wzl.todolisthelper.dto.AddTaskComment;
import org.wzl.todolisthelper.service.TaskCommentService;
import org.wzl.todolisthelper.utils.Resp;

@Slf4j
@RestController
@RequestMapping("/taskComment")
public class TaskCommentController {

    @Resource
    private TaskCommentService taskCommentService;

    @PostMapping("/addTaskComment")
    public Resp<?> addTaskComment(@RequestBody @Validated AddTaskComment addTaskComment) {
        log.info("addTaskComment: {}", addTaskComment);
        taskCommentService.addTaskComment(addTaskComment);
        return Resp.ok();
    }

}
